﻿@model Providers
@section ToolBar{
    <div class="r-c-tool">
        <a href="javascript:location.reload();" class="l-btn fa fa-refresh"></a>
        <a href="javascript:void(0);" class="l-btn fa fa-search"></a>
    </div>
    <div class="r-c-list">
        @Html.LActionLink("新建供应商", "Edit", "Provider", new { }, new { @class = "l-btn", single = "single" })
    </div>
}
<div class="l-m-table">
    <table>
        <tr class="bgc3">
            <th>客户编号</th>
            <th>公司简称</th>
            <th>公司全称</th>
            <th>负责人</th>
            <th>联系人</th>
            <th>手机</th>
            <th>地址</th>
            <th>应付款</th>
            <th>未完成订单数</th>
            <th>是否启用</th>
            <th>操作</th>
        </tr>
        @if (Model == null || Model.Items.Count <= 0)
        {
            <tr>
                <td colspan="9" class="t-c c0">暂无记录</td>
            </tr>
        }
        @foreach (Provider p in Model.Items)
        {
            <tr>
                <td class="bd-left">@Html.LActionLink(p.CompanyNo, "Detail", "Provider", new { id = p.ProviderId })</td>
                <td>@p.CompanyName</td>
                <td>@p.FullName</td>
                <td>@p.Employee.EmployeeName</td>
                <td>@p.ContactName</td>
                <td>@p.Mb</td>
                <td>@p.Address</td>
                <td class="red">@p.AccountPayables.MoneyFormat()</td>
                <td>@p.NotCompletedOrderCount</td>
                <td>@p.IsActive.StateFormat()</td>
                <td class="t-c">
                    @Html.LActionLink("修改", "Edit", "Provider", new { id = p.ProviderId }, new { single = "single" })
                    @Html.LAjaxPost("删除", new { providerId = p.ProviderId, url = Url.Action("Delete", "Provider"), callback = "callbackRemoveTr", tag = "delete" })
                    @Html.LAjaxPost(p.IsActive ? "禁用" : "启用", new { providerId = p.ProviderId, isActive = !p.IsActive, url = Url.Action("Active", "Provider") })
                </td>
            </tr>
        }
    </table>
</div>
@section Pager{
    @Html.Pager("Index", "Product", Model.TotalCount, (int)ViewBag.PageIndex, 20)
}